package org.example.controller;

import org.example.domain.entity.SysDepartment;
import org.example.domain.vo.DeptVo;
import org.example.result.VividResult;
import org.example.service.ISysDeptService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("sys/dept")
public class SysDeptController {
    private final ISysDeptService sysDeptService;

    public SysDeptController(ISysDeptService sysDeptService) {
        this.sysDeptService = sysDeptService;
    }

    @GetMapping("/allList")
    public VividResult getAllDepts(){
        List<DeptVo> departments = sysDeptService.selectAllDepts();
        return VividResult.success(departments);
    }

    @GetMapping("/getDept")
    public VividResult getDeptById(){
       // SysDepartment sysDepartment = sysDeptService.selectDeptById();
        return VividResult.success();
    }


}
